<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=8">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <link rel="stylesheet" href="/static/plugins/editormd/css/editormd.css"/>
    <style>
        body{
            padding: 0;
        }
    </style>
</head>
<body>
    <div id="editormd">
                <textarea style="display:none;">
</textarea>
    </div>

<script src="/static/plugins/jQuery/jQuery-2.1.3.min.js"></script>
<script src="/static/plugins/editormd/editormd.min.js"></script>
<script type="text/javascript">
    var editor;

    $(function () {
        editor = editormd("editormd", {
            //autoHeight : true,
            width: "100%",
            height: 600,
            path: "/static/plugins/editormd/lib/",
            toolbarIcons : function() {
                return["undo", "redo", "|", "bold", "del", "italic", "quote", "ucwords", "uppercase", "lowercase", "|", "h1", "h2", "h3", "h4", "h5", "h6", "|", "list-ul", "list-ol", "hr", "|", "link", "reference-link", "image", "code", "code-block", "table", "datetime", "html-entities", "pagebreak", "|", "watch", "clear", "search"]
            },
            imageUpload : true,
            imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
            imageUploadURL : "/admin/imgUp",
            onload: function(){
                var postId = $('#postId', parent.document).val();
                if(postId){
                    this.setMarkdown($('#postContent', parent.document).val());
                } else {
                    this.setMarkdown('');
                }
            }
        });

        /*
         // or
         testEditor = editormd({
         id      : "test-editormd",
         width   : "90%",
         height  : 640,
         path    : "../lib/"
         });
         */
    });
</script>
</body>
</html>